<div class="row">
   
   <?php foreach( $data as $key ): ?>
    	<div class="col-sm-6 col-md-3 col-thumb">
    		
   <?php 
   
   if( Auth::check() ) {
   $likeUser = Like::where( 'shots_id', $key->id )->where('user_id',Auth::user()->id)->where('status',1)->first(); 
   }
   
   /*if( Str::slug( $key->title ) == '' ) {
   	    
		$slugUrl  = '-'.Str::slug( $key->title );
	    $url_shot = URL::to('/').'/shots/'.$key->id.$slugUrl;
	} else {
		$slugUrl = Str::slug( $key->title );
		$url_shot = URL::to('/').'/shots/'.$key->id.'-'.$slugUrl;
	}*/
	if( Str::slug( $key->title ) == '' ) {
   	    
		$slugUrl  = '';
	} else {
		$slugUrl  = '-'.Str::slug( $key->title );
	}
	
	$url_shot = URL::to('/').'/shots/'.$key->id.$slugUrl;
   //print_r($likeUser); 
   ?>
	 
    		<div class="thumbnail <?php if( isset( $shots_users ) ): ?> padding-top-zero <?php endif; ?>">
    			
    			
    			<div class="caption">
    				<p class="author p-author">
    				
    				<?php if( $key->user()->type_account == 2 ): ?> 	
    					<a href="<?php echo URL::to('pro'); ?>" class="label label-primary btn-pro-xs pull-right">
    						<?php echo Lang::get('misc.pro'); ?>

    						</a>
    					<?php endif; ?>
    					
    					<?php if( $key->user()->type_account == 3 ): ?> 	
    					<a href="<?php echo URL::to('teams'); ?>" class="label label-primary btn-team-xs pull-right">
    						<?php echo Lang::get('misc.team'); ?>

    						</a>
    					<?php endif; ?>
    					
    					<a href="<?php echo URL::to('/'); ?>/<?php echo '@'.$key->user()->username; ?>" class="myicon-right">
    						<img src="<?php echo URL::asset('public/avatar').'/'.$key->user()->avatar; ?>" width="20" height="20" class="img-circle img-avatar-shots" />
    					</a>
    					
    					<a href="<?php echo URL::to('/'); ?>/<?php echo '@'.$key->user()->username; ?>" class="myicon-right text-decoration-none" title="<?php echo $key->user()->name; ?>">
    					  <?php echo e( $key->user()->name ); ?> 
    					  </a>
    					  
    					  
    					</p>
    			</div><!-- /caption -->
    			
    			
    				<a class="position-relative btn-block" href="<?php echo $url_shot; ?>">
    				
    				<?php if( $key->extension == 'gif' ): ?>
    					<small class="gif-shot">GIF</small>
    				<?php endif; ?>
    					<img title="<?php echo e($key->title); ?>" src="<?php echo URL::asset('public/shots_img') .'/'.$key->image; ?>" class="image-url img-responsive btn-block" />
    				</a>
    			
    			<div class="caption">
    				<h1 class="title-shots">
    					<a title="<?php echo $key->title; ?>" class="item-link" href="<?php echo $url_shot; ?>">
    					 <?php echo e($key->title); ?>

    					</a>
    				</h1>
    			</div><!-- /caption -->
    			
    			<div class="caption">
    				<p class="actions">
    					
    				
    					<?php if(Auth::check()): ?>
    					<span data-id="<?php echo $key->id; ?>" data-like="<?php echo Lang::get('misc.like'); ?>" data-like-active="<?php echo Lang::get('misc.unlike'); ?>" title="<?php if(!empty($likeUser)): ?> <?php echo Lang::get('misc.unlike'); ?> <?php else: ?> <?php echo Lang::get('misc.like'); ?> <?php endif; ?>" class="btn btn-xs pull-left <?php if(!empty($likeUser)): ?> btn-success <?php else: ?> btn-danger <?php endif; ?> btn-like likeButton <?php if(!empty($likeUser)): ?> active <?php endif; ?>">
    						<i class="glyphicon glyphicon-heart"></i>
    					</span>
    					<?php else: ?>
    						
    					<a href="<?php echo URL::to('login'); ?>" class="btn btn-xs pull-left btn-danger btn-like shotTooltip" data-toggle="tooltip" data-placement="top" title="<?php echo Lang::get('misc.sign_in_or_sign_up'); ?>">
    						<i class="glyphicon glyphicon-heart"></i>
    					</a>
    					<?php endif; ?>
    				
    					<span class="pull-right">
    						<i class="fa fa-heart myicon-right"></i> <span class="like_count myicon-right strongSpan"><?php echo Helper::formatNumber( Shots::totalLikes( $key->id ) ); ?></span>
    						<i class="fa fa-eye myicon-right"></i> <span class="myicon-right strongSpan"><?php echo Helper::formatNumber( Shots::totalVisits( $key->id ) ); ?></span>
    						<i class="fa fa-comment myicon-right"></i> <span class="myicon-right strongSpan"><?php echo Helper::formatNumber( Shots::totalComments( $key->id ) ); ?></span>
    						<?php if( $key->attachment != '' ): ?>	
    						<i class="icon-attachment myicon-right shotTooltip attachment" title="<?php echo Lang::get('misc.has_attachments'); ?>" data-toggle="tooltip" data-placement="top"></i>
    					   <?php endif; ?>
    					</span>
    					
    				</p>
    			</div><!-- /caption -->
    			
    		  </div><!-- /thumbnail -->
    		  
    	   </div><!-- /col-sm-6 col-md-4 -->
    	   
    	  <?php endforeach; ?>
        
    	  </div><!-- /row -->

   	    	  
     <?php if( $data->getTotal() != $data->count() ): ?>
     
    	   <hr />
    	   
    	   <?php if( Request::is('search') ): ?>
			<div class="btn-group paginator-style">
			   <?php echo $data->appends( array( 'q' => $q ) )->links(); ?> 
			</div>

		<?php else: ?>

		<div class="btn-group paginator-style">
		   <?php echo $data->links(); ?> 
		</div>
		
		<?php endif; ?> 
<?php endif; ?>
